﻿//  --------------------------------
//  Copyright (c) AW Systems, Inc. All rights reserved.
//  This source code is made available under the terms of the Microsoft Public License (Ms-PL)
//  http://www.codeplex.com/SLAM/license
//  ---------------------------------

using System;
using System.Collections;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace AWS.SLAM.Configuration
{
    /// <summary>
    /// Defines the section of a SLAM configuration that defines what types, fields, and associations SLAM
    /// should manage.  This is the only required section for configuring SLAM's basic functionality.
    /// 
    /// A DataMapping section provides functionality for retrieving all configured Types, all configured Associations
    /// for a Type, all Fields for a Type and individual properties or attributes used to define to a Type.
    /// </summary>
    public abstract class DataMapping
    {
        /// <summary>
        /// Gets all Types in the configuration.
        /// </summary>
        /// <returns></returns>
        public abstract IEnumerable<ConfiguredType> GetAllTypes();

        /// <summary>
        /// Gets fields that are associations for the given type id or name.
        /// </summary>
        /// <param name="id"></param>
        /// <param name="typeName"></param>
        /// <returns></returns>
        public abstract IEnumerable<AssociationField> GetTypeAssociations(string id, string typeName);

        /// <summary>
        /// Gets a Type's custom attribute by name for the given type id or type name.
        /// </summary>
        /// <param name="id"></param>
        /// <param name="typeName"></param>
        /// <param name="attributeName"></param>
        /// <returns></returns>
        public abstract string GetTypeAttribute(string id, string typeName, string attributeName);

        /// <summary>
        /// Gets fields that are not associations for the given type id or name.
        /// </summary>
        /// <param name="id"></param>
        /// <param name="typeName"></param>
        /// <returns></returns>
        public abstract IEnumerable<Field> GetTypeFields(string id, string typeName);
    }
}
